﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using DomainDriver.DomainModeling.StorageManagers.DataSetStorage;

namespace AutomotivePricingModel
{
    public static class AutomotivePricingDataSetExtensions
    {
        public static AutomotivePricingDataSet.BodyStylesDataTable BodyStylesTable(this DataSet dataSet)
        {
            AutomotivePricingDataSet typedDataSet = (dataSet as AutomotivePricingDataSet);
            if (typedDataSet == null)
            { throw new InvalidOperationException("The provided DataSet is not of type AutomotivePricingDataSet."); }

            return typedDataSet.BodyStyles;
        }

        public static AutomotivePricingDataSet.BrandsDataTable BrandsTable(this DataSet dataSet)
        {
            AutomotivePricingDataSet typedDataSet = (dataSet as AutomotivePricingDataSet);
            if (typedDataSet == null)
            { throw new InvalidOperationException("The provided DataSet is not of type AutomotivePricingDataSet."); }

            return typedDataSet.Brands;
        }

        public static AutomotivePricingDataSet.CompaniesDataTable CompaniesTable(this DataSet dataSet)
        {
            AutomotivePricingDataSet typedDataSet = (dataSet as AutomotivePricingDataSet);
            if (typedDataSet == null)
            { throw new InvalidOperationException("The provided DataSet is not of type AutomotivePricingDataSet."); }

            return typedDataSet.Companies;
        }
    }
}